def substr(s, ss):
	i = 0
	while i < len(s) - len(ss) + 1:
		if same(s, i, ss):
			return i
		else:
			i = i + 1
	return -1	

def same(a, i, b):
	l1 = len(a)
	l2 = len(b)
	if i <= len(a) - len(b):
		s = ''
		j = 0
		while j < l2:
			s = s + a[i]
			i = i + 1
			j = j + 1
		if s == b:
			return True
		else:
			return False
	else:
		return False

print substr("1234", "abc")

print "abcdefsdfsdf"[-3:]
print ''
